﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;

namespace HelpDesk.Models
{
    public class Activity
    {
        private  static HelpDeskDbContext _db = HelpDeskDbContext.Instance;

        [Display(Name = "Activity ID")]
        [Key]
        public int ActivityID { set; get; }

        [Display(Name = "Comment")]
        [Required]
        public string Text { get; set; }

       
        public virtual Ticket Ticket { get; set; }

        [Display(Name = "Posted On")]
        public DateTime Created { get; set; }

        [Display(Name = "Submitted By")]
        public virtual UserProfile SubmittedBy { get; set; }

        public static void AddActivity(Activity Activity)
        {
            _db.Activities.Add(Activity);
            _db.SaveChanges();
        }

    }
}